# 指定 CMake 最低版本
cmake_minimum_required(VERSION 3.10)

project(TallyServer)

set(srcs server.cpp
        ../log/log4z.cpp
        mysqlManager.cpp
        main.cpp)

# 设置 C++11
set(CMAKE_CXX_STANDARD 11)

# 添加 C++ 编译参数
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")

# 生成可执行程序
add_executable(TallyServer ${srcs})
# 1. 添加 MySQL 库目录，MySQL 安装完成后库在 /usr/lib 目录下
# 2. 引用 MySQL 库，链接到 mysqlclient 动态库中
link_libraries(/usr/lib)
target_link_libraries(TallyServer mysqlclient)
